// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    UserAvatarurl:"",
    UserNickName:"",
    token:"",
    hasUserInfo:false,
    canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
  },
  // 事件处理函数
  bindViewTap() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },

  onLoad() {
    let that = this
      var HasUserInfo = wx.getStorageSync('hasUserInfo')
      var Code = wx.getStorageSync('code')
      var userNickName = wx.getStorageSync('UserNickName')
      var userAvatarUrl = wx.getStorageSync('UserAvatarUrl')
        console.log(HasUserInfo)
        console.log(Code)
        console.log(userNickName)
        console.log(userAvatarUrl)
        that.setData({
          UserNickName :  userNickName,
          UserAvatarurl : userAvatarUrl,
          code : Code ,
          hasUserInfo : HasUserInfo,

        })
    console.log("读取缓存数据成功")

  },
  






  openSetting :function(){
    wx.openSetting({
      withSubscriptions: true,
    })
  },



  contact :function(){
    wx.showModal({
      title:"反馈",
      content:"可以反馈 但我不让 哎~就是玩儿"

    })
  }
})
